/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package oids;

import javax.swing.JFrame;
import javax.swing.Timer;
import oids.frontEnd.gameEngine.GameEngine;
import oids.frontEnd.highScore.HighScore;

/**
 *
 * @author CJ
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here

        JFrame jFrame = new JFrame("Oids");
        GameEngine engine = new GameEngine();
        jFrame.setContentPane(engine);

        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jFrame.pack();
        jFrame.setVisible(true);

        int delay = 50;
        Timer timer = new Timer(delay, engine);
        timer.start();
        while(!engine.getGameOver()){
            
        }
        try{
            Thread.sleep(2000);
        }catch(Exception e){
            e.printStackTrace();
        }
        timer.stop();

        HighScore highScore = new HighScore();
        jFrame.setContentPane(highScore);

        jFrame.pack();
        jFrame.setVisible(false);
        jFrame.setVisible(true);

    }

}
